package com.stars.easyms.logger.util;

import net.bytebuddy.ByteBuddy;
import net.bytebuddy.dynamic.loading.ClassReloadingStrategy;
import org.springframework.boot.SpringBootVersion;
import org.springframework.boot.logging.logback.LogbackLoggingSystem;

/**
 * <p>className: SpringBootLoggingSystemUtil</p>
 * <p>description: 如果是springboot项目需要考虑LoggingSystem</p>
 *
 * @author guoguifang
 * @date 2019-11-14 17:16
 * @since 1.4.0
 */
public final class SpringBootLoggingSystemUtil {

    public static String getEasyMsLogbackLoggingSystemClassName() {
        // 替换logback的LoggingSystem
        String springBootVersion = SpringBootVersion.getVersion();
        Class<?> easyMsLogbackLoggingSystemClass = springBootVersion.startsWith("1.") ?
                com.stars.easyms.logger.support.logback.springboot.version1xx.EasyMsLogbackLoggingSystem.class :
                com.stars.easyms.logger.support.logback.springboot.version2xx.EasyMsLogbackLoggingSystem.class;
        return easyMsLogbackLoggingSystemClass.getName();
    }

    private SpringBootLoggingSystemUtil() {
    }
}